{extend name="admin/public/base"/}
{block name="body"}
<div class="box box-primary">
	<div class="box-header with-border">
		<h3 class="box-title">{$meta_title}</h3>
		<div class="box-tools pull-right">
			<a class="btn btn-sm btn-primary" href="{:url('/admin/channel/add')}">新 增</a>
			<button class="btn btn-sm btn-danger ajax-post confirm" url="{:url('/admin/channel/del')}" data-form="ids">删 除</button>
			<button class="btn btn-sm btn-success list_sort" url="{:url('/admin/channel/sort')}">排序</button>
		</div>
	</div>
	<div class="box-body">
		<div class="nav-tabs-custom">
			<ul class="nav nav-tabs">
				<li {if 0 eq $type}class="active"{/if}><a href="{:url('/admin/channel/index',array('type'=>0))}">全部</a></li>
				{volist name="config['nav_type_list']" id="item"}
				<li {if $item['key'] == $type}class="active"{/if}>
					<a href="{:url('/admin/channel/index',array('type'=>$item['key']))}">{$item['label']}</a>
				</li>
				{/volist}
			</ul>
			<div class="tab-content">

				<div class="table-responsive clearfix">
					<table class="table table-hover">
						<thead>
							<tr>
								<th width="30"><input class="checkbox check-all" type="checkbox"></th>
								<th width="60">ID</th>
								<th>名称</th>
								<th>URL</th>
								<th width="120">排序</th>
								<th>状态</th>
								<th>操作</th>
							</tr>
						</thead>
						<tbody>
							{volist name="tree" id="list"}
							<tr>
								<td><input class="ids row-selected" type="checkbox" name="id[]" value="{$list.id}"></td>
								<td>{$list['id']}</td>
								<td>
									{$list['level_show']|raw}
									<a href="#" class="editable editable-click" data-id="{$list['id']}" data-name="title" data-type="text" data-pk="{$list['id']}" data-url="{:url('/admin/channel/editable')}">{$list['title']} </a>
									<a class="add-sub-cate" title="添加子分类" href="{:url('/admin/channel/add', ['pid' =>$list['id']])}">
										<i class="fa fa-plus-square"></i>
									</a>
								</td>
								<td><a href="#" class="editable editable-click" data-id="{$list['id']}" data-name="url" data-type="text" data-pk="{$list['id']}" data-url="{:url('/admin/channel/editable')}">{$list['url']}</a></td>
								<td><a href="#" class="editable editable-click" data-id="{$list['id']}" data-name="sort" data-type="text" data-pk="{$list['id']}" data-url="{:url('/admin/channel/editable')}">{$list['sort']}</a></td>
								<td>
									{if $list['status']}
									<span class="label label-primary">{$list['status_text']}</span>
									{else/}
									<span class="label label-danger">{$list['status_text']}</span>
									{/if}
								</td>
								<td>
									<a title="编辑" href="{:url('/admin/channel/edit?id='.$list['id'].'&pid='.$list['pid'])}">编辑</a>
									<a title="{$list['status'] ? '禁用' : '启用'}" href="{:url('/admin/channel/setStatus', ['id'=>$list['id'], 'status'=>abs(1-$list['status'])])}" class="ajax-get">{$list['status'] ? '禁用' : '启用'}</a>
									<a title="删除" href="{:url('/admin/channel/del', ['id' =>$list['id']])}" class="confirm ajax-get">删除</a>
								</td>
							</tr>
							{/volist}
						</tbody>
					</table>
				</div>
			</div>
		</div>
	</div>
</div>
{/block}